home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n16.arc / TRYPOINT.CPP < prev    next >
C/C++ Source or Header  |  1991-08-27  |  1KB  |  50 lines

  1. // TRYPOINT.CPP - Try Point and Pixel Classes
  2. // Compile with Borland C++ 2.0
  3. // Copyright (C) 1991 Ziff Davis Communications
  4. // PC Magazine * Ray Duncan May 1991
  5.  
  6. #include <iostream.h>
  7. #include "point.h"
  8.  
  9. main()
  10. {
  11.     int tempX, tempY, tempColor;                // scratch variables    
  12.     double degrees;
  13.  
  14.     PIXEL myPixel(0,0,0);
  15.  
  16.     cout << "\nEnter X coordinate:   ";         // prompt for pixel
  17.     cin >> tempX;                               // location and color
  18.     cout <<   "Enter Y coordinate:   ";
  19.     cin >> tempY;
  20.     cout <<   "Enter pixel color:    ";
  21.     cin >> tempColor;
  22.  
  23.     myPixel.setX(tempX);                        // set pixel value
  24.     myPixel.setY(tempY);
  25.     myPixel.setColor(tempColor);
  26.  
  27.     cout << "\nEnter X translation:  ";         // prompt for pixel
  28.     cin >> tempX;                               // translation and
  29.     cout <<   "Enter Y translation:  ";         // rotation
  30.     cin >> tempY;
  31.     cout <<   "Enter rotation (deg): ";
  32.     cin >> degrees;
  33.  
  34.     myPixel.translate(tempX, tempY);            // now apply translation
  35.     myPixel.rotate(degrees);                    // and rotation factors
  36.     
  37.     cout << "\nNew value of pixel:  ";          // display new pixel values
  38.     myPixel.display();
  39. }
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.